/*
 * Created on Nov 18, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.user;


import java.util.Date;

import org.vectrics.common.db.ChangeReportable;
import org.vectrics.common.db.OwnedObject;
import org.vectrics.common.db.RecordObject;
import org.vectrics.common.db.Voidable;
import org.vectrics.common.util.DateUtil;
import org.vectrics.domain.Domain;
import org.vectrics.provider.CoreServiceLocator;
import org.vectrics.recruiter.document.CandidateDocument;


public class Resume implements RecordObject, Voidable, ChangeReportable, OwnedObject {
	private Long id = null;
	private CandidateInfo candidateInfo = null;
	private String name = "Resume";
	private Date lastUpdate = new Date();
	private CandidateDocument document = null;
	private Domain domain = null;
	private boolean voided = false;
	
	
	public Resume() {
		super();
	}
	
	public String getTextResume() {
		return document.getTextContent();
	}

	/**
	 * @return Returns the document.
	 */
	public CandidateDocument getDocument() {
		return document;
	}

	/**
	 * @param document The document to set.
	 */
	public void setDocument(CandidateDocument document) {
		this.document = document;
		this.document.setDomain(this.getDomain());
	}

	/**
	 * @return Returns the candidateInfo.
	 */
	public CandidateInfo getCandidateInfo() {
		return candidateInfo;
	}

	/**
	 * @param candidateInfo The candidateInfo to set.
	 */
	public void setCandidateInfo(CandidateInfo candidateInfo) {
		this.candidateInfo = candidateInfo;
	}

	/**
	 * @return Returns the id.
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id The id to set.
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name The name to set.
	 */
	public void setName(String name) {
		this.name = name;
	}

	public Date getLastUpdate() {
		return lastUpdate;
	}

	public void setLastUpdate(Date lastUpdate) {
		this.lastUpdate = lastUpdate;
	}	
	
	/**
	 * @return Returns the domain.
	 */
	public Domain getDomain() {
		return domain;
	}

	/**
	 * @param domain The domain to set.
	 */
	public void setDomain(Domain domain) {
		this.domain = domain;
	}

	/**
	 * @return Returns the voided.
	 */
	public boolean getVoided() {
		return voided;
	}
	
	/**
	 * @param voided The voided to set.
	 */
	public void setVoided(boolean voided) {
		this.voided = voided;
	}
	
	
	public String toString() {
		return("id=" + this.id + "|name=" + this.name + "|domain=" + this.domain
				+ "|document=" + this.document 
				+ "|voided=" + this.voided);
	}
}
